<?php
namespace app\api\validate\Collection;

use bang\validate\Validate;

/**
 * 收藏类的验证类
 * Class Collection
 * @package app\api\validate\Collection
 */
class CollectionValidate  extends Validate
{

    protected $rule =   [
        'goods_id'  => 'require|>:0',
        'user_id'  => 'require|>:0',
        'type'  => 'require|in:1,2',
    ];

    protected $message  =   [
        'goods_id.require' => '缺少商品ID',
        'user_id.require' => '缺少用户ID',
        'type.require' => '缺少类型',
        'type.in' => '缺少类型',
    ];

    protected $field = [
        'goods_id' => '商品ID',
        'user_id' => '用户ID',
        'type' => '类型',
    ];

    protected $scene = [
        'goodsCollectionAdd'  =>  ['goods_id' , 'user_id' , 'type'],
        'goodsCollectionCancel'  =>  ['goods_id' , 'user_id' , 'type'],
    ];




}